package models

import (
	"github.com/astaxie/beego/orm"
	"fmt"
)

type ra_user struct {
	Id int
	Username string
	Password string
	Roleid int
	Sex string
	Age int
	Salt string
	Phone string
	Mail string
	Photo string
	Address string
	Accountid string
	Del_flag string
	Createtime string
}

func FindData() []orm.Params  {
	user:=new(ra_user)
	o:=orm.NewOrm()
	var result []orm.Params
	num,err:=o.QueryTable(user).Values(&result,
		"id","username","password","roleid","sex","age","salt","phone",
		"mail","photo","address","accountid","del_flag","createtime") //返回结果集，存在result里
	if err==nil {
		fmt.Println("结果数量：",num)
		return result
	}else {
		fmt.Println("查询失败")
		return nil
	}
}